<template>
  <div class="online-content">
    <van-nav-bar title="在线内容" right-text="按钮" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
      <!-- <template #left>
        <van-icon name="search" size="18" />
      </template> -->
      <template #right>
        <!-- <van-icon name="search" size="18" /> -->
        <van-icon name="ellipsis" />
      </template>
    </van-nav-bar>

    <iframe :src="url" class="iframe-wrap"></iframe>

  </div>
</template>

<script>

import { NavBar, Icon, Image } from 'vant';
import { Online } from "@/api/online"

export default {
  components: {
    [NavBar.name]: NavBar,
    [Icon.name]: Icon,
    [Image.name]: Image,
  },
  data() {
    return {
      url: 'http://iot-ai.tuling123.com/jump/app/source?apiKey=43597ff27dfc475ebca7f4a99b89f8ac&uid=918F440C5FA4&client=android'
    }

  },
  mounted() {
    // this.init()
  },
  methods: {
    async init() {
      let postData1 = {
        "apiKey": "43597ff27dfc475ebca7f4a99b89f8ac",
        'uid': '',
        'deviceId': ''
      }
      const data1 = await Online.bindStatus(postData1)


      let postData2 = {
        "apiKey": "43597ff27dfc475ebca7f4a99b89f8ac",
        'uid': '',
        'deviceId': '',
        'name': '',
        'imageUrl': ''
      }
      const data2 = await Online.bind(postData2)


      const data3 = await Online.clearPlayList('43597ff27dfc475ebca7f4a99b89f8ac', 'mDeviceId')


      const url = "http://iot-ai.tuling123.com/jump/app/source?apiKey=43597ff27dfc475ebca7f4a99b89f8ac&uid=" + 'MyApplication.getInstence().getUid()' + "&client=android";

      this.url = url
      return { data1, data2, data3 }

    },
    onClickLeft() {

    },
    onClickRight() {

    },

  }
};
</script>

<style lang="less">
.online-content {
  .iframe-wrap {
    width: 100%;
    height: calc(100vh - 44px);
    border: none;
  }
}
</style>
